package cn.wangxl.vertx.starter.deploy;

import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;

/**
 * @Deacription 代码发布verticle
 * @Author 20112128
 * @Date 2020/5/13 9:49
 **/
public class StartVerticle {
  public static void main(String[] args) {


//    deployOneInstance();


    deployMoreInstances(5);
  }

  public static void deployMoreInstances(int instances) {

    Vertx vertx = Vertx.vertx();

    DeploymentOptions options = new DeploymentOptions().setInstances(instances);
    vertx.deployVerticle("cn.wangxl.vertx.starter.deploy.MyVerticle",options);
  }

  public static void deployOneInstance() {

    Vertx vertx = Vertx.vertx();
    vertx.deployVerticle("cn.wangxl.vertx.starter.deploy.MyVerticle");
  }
}
